package ai.people.core.feign.api.oss;

import ai.people.core.feign.config.FeignConfig;
import ai.people.netmon.framework.domain.oss.vo.UploadVO;
import ai.people.netmon.framework.model.response.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author yuanqinglong
 * @date 2022/8/5 14:12
 */
@FeignClient(value = "NM-SERVICE-OSS", path = "oss",configuration = FeignConfig.class)
public interface OssFeignClient {

    /**
     * 上传文件
     *
     * @param multipartFile 多部分文件
     * @return {@link Result}<{@link UploadVO}>
     */
    @PostMapping(value = "/file/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<UploadVO> uploadFile(@RequestPart("file") MultipartFile multipartFile);
}
